package com.mlming.springboot.controller;

import com.mlming.springboot.service.CategoryService;
import com.mlming.springboot.vo.CategoryVo;
import com.mlming.springboot.vo.ResponseVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CategoryController {
    @Autowired
    private CategoryService categoryService;

    /**
     * 获取所有类目
     * @return
     */
    @GetMapping("/category/getall")
    public ResponseVo<List<CategoryVo>> getAllCategories() {
        return categoryService.getAllCategories();
    }

}
